# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=tslib
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.23
pkgrel=2
pkgdesc="Touchscreen Access Library (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/kergoth/tslib"
license=('spdx:LGPL-2.1-only')
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools"
             "${MINGW_PACKAGE_PREFIX}-cc")
source=("https://github.com/kergoth/tslib/releases/download/${pkgver}/${_realname}-${pkgver}.tar.xz")
sha256sums=('9b489a54d48006201f2fe955a88c3f857535ac93b6cf8e5a16c7b166c8991dac')

build() {
  mkdir -p "build-${MSYSTEM}" && cd "build-${MSYSTEM}"

  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc \
    --enable-static \
    --enable-shared \
    --disable-input \
    --disable-touchkit \
    --disable-waveshare
    
  make
}

package() {
  cd "build-${MSYSTEM}"
  make install DESTDIR="${pkgdir}"
}
